package com.api.shopapi.mapper;

import com.api.shopapi.entity.NursingSchedulingNight;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface NursingSchedulingNightMapper {

    @Insert("insert into  nursing_scheduling_night " +
            "(NursingSchedulingNightCode,NursingSchedulingCode) " +
            "values (#{nursingSchedulingNight.NursingSchedulingNightCode} ,#{nursingSchedulingNight.NursingSchedulingCode} )")
    int insert(@Param("nursingSchedulingNight") NursingSchedulingNight nursingSchedulingNight);

    @Update("update nursing_scheduling_night set NursingSchedulingCode=#{nursingSchedulingNight.NursingSchedulingCode} where NursingSchedulingNightCode=#{nursingSchedulingNight.NursingSchedulingNightCode}   ")
    int updateByNursingSchedulingNightCode(@Param("nursingSchedulingNight") NursingSchedulingNight nursingSchedulingNight);

    @Delete("delete from nursing_scheduling_night where nursingSchedulingNightCode=#{nursingSchedulingNightCode} ")
    int deleteByNursingSchedulingNightCode(@Param("nursingSchedulingNightCode")String nursingSchedulingNightCode);

    @Select("select * from nursing_scheduling_night where NursingSchedulingNightCode=#{nursingSchedulingNightCode} limit 1")
    NursingSchedulingNight getByNursingSchedulingNightCode(@Param("nursingSchedulingNightCode")String nursingSchedulingNightCode);

    @Select("select * from nursing_scheduling_night where NursingSchedulingCode=#{nursingSchedulingCode} limit 1")
    NursingSchedulingNight getByNursingSchedulingCode(@Param("nursingSchedulingCode") String nursingSchedulingCode);
}
